package com.paradogs.gs.modules.attr;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author: yumi
 * @date: 2024/12/16  15:53
 * @Description: TODO
 */
@Slf4j
@Component
public class AttrService {

    public Map<Integer, Integer> calFinalAttr(Map<Integer, Integer> attr) {
        Map<Integer, Integer> finalAttr = new LinkedHashMap<>();
        for (FinalAttrType finalAttrType : FinalAttrType.values()) {
            finalAttr.put(finalAttrType.id(), finalAttrType.exec().apply(attr));
        }
        return finalAttr;
    }

}
